package myLucene;

import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.util.LinkedList;

public class PrintDist {

	public static void printDist (LinkedList<Integer>[] dist, String term,String[] intToTerms) throws IOException{
		BufferedWriter bw = new BufferedWriter(new FileWriter(new File("/local/joofeit/"+term+"_dist")));
		for(int x =0 ;x <dist.length;x++ ){
			String line = intToTerms[x];
			for(int i: dist[x]){
				line= i+" " +line;
			}
			if(dist[x].isEmpty()){
				line= Integer.MAX_VALUE+" "+line;
			}
			bw.write(line+"\n");
			
		}
		bw.flush();
		bw.close();
	}
}
